package com.zjs.practice.main;

import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.codec.binary.Base64;

import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
import java.util.ArrayList;
import java.util.List;

/**
 * 测试类1
 * @date 2019/12/17 23:55
 * @version 1.0
 */
@Slf4j
public class Main1 {

    public static void main(String[] args) {
        System.out.println("主线程开始");
        Thread thread = new Thread(){
            @Override
            public void run() {
                System.out.println("线程开始");
//                Curr
//                Thread thread = new Thread(){
//                    @Override
//                    public void run() {
//                        System.out.println("守护线程开始");
//                        while (close) {
//                            try {
//                                System.out.println("守护线程正在执行");
//                                Thread.sleep(1000);
//                            } catch (InterruptedException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                    }
//                };
//                thread.setDaemon(true);
//                thread.start();
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("线程结束");
            }
        };
        thread.start();
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("主线程结束");
    }
}